proc mousetogrid % This is the procedure to translate mouse x and y into

    for searchx : 1 .. 10
	if mousex >= (searchx - 1) * 20 and mousex <= searchx * 20 then % if the mousex is in between the left and right coords of this square
	    userx := searchx % store that in mousex
	end if
    end for
    % Same thing, but get the y coord this time.
    for searchy : 1 .. 10
	if mousey >= (searchy - 1) * 20 and mousey <= searchy * 20 then
	    usery := searchy
	end if
    end for
end mousetogrid
